<admintpl file="header" />
<body class="J_scroll_fixed">
<div class="wrap js-check-wrap">
  <ul class="nav nav-tabs">
     <li class="active"><a href="{:U('AdminCourse/index')}"  target="_self">普通课程</a></li>
	 <li><a href="{:U('AdminCourse/zhibo')}"  target="_self">直播课程</a></li>
	 <li><a href="{:U('AdminCourse/doc')}"  target="_self">文本课程</a></li>
  </ul>
  <form class="well form-search" method="post" action="{:u('AdminCourse/index')}">
    <div class="search_type cc mb10">
      <div class="mb10"> 
        <span class="mr20">分类：
        <select class="select_2" name="term">
          	<option value='0' >全部</option>
          	{$taxonomys}
        </select>
        &nbsp;&nbsp;时间：
        <input type="text" name="start_time" class="input length_2 js-date" value="{$formget.start_time|default=''}" style="width:100px;" autocomplete="off">-<input type="text" class="input length_2 js-date" name="end_time" value="{$formget.end_time}" style="width:100px;" autocomplete="off">
        
        <!-- 
        <select class="select_2" name="searchtype" style="width:70px;">
          <option value='0' >标题</option>
        </select>
         -->
               &nbsp; &nbsp;关键字：
        <input type="text" class="input length_2" name="keyword" style="width:200px;" value="{$formget.keyword}" placeholder="请输入关键字...">
        <input type="submit" class="btn" value="搜索"/>
        </span>
      </div>
    </div>
  </form>
  <form class="js-ajax-form" action="" method="post">
      <table width="100%" class="table table-hover  table-list">
        <thead>
	          <tr>
	            <th width="16"><label><input type="checkbox" class="js-check-all" data-direction="x" data-checklist="js-check-x"></label></th>
	            <th width="50">排序</th>
	            <th width="40">ID</th>
	            <th>课程名称</th>
	            <th>所属分类</th>
	            <th width="100">标签</th>
	            <th width="60">学员数</th>
	            <th width="60">发布人</th>
	            <th width="130"><span>发布时间</span></th>
	            <th width="60">状态</th>
	            <th width="100">操作</th>
	          </tr>
        </thead>
        	<php>
        		$status=array("1"=>"已审核","0"=>"未审核");
        		$recommend_status=array("1"=>"已推荐","0"=>"未推荐");
        	</php>
        	<foreach name="courselist" item="vo">
	        	<tr> 
		            <td><input type="checkbox" class="js-check" data-yid="js-check-y" data-xid="js-check-x" name="ids[]" value="{$vo.id}"></td>
		            <td><input name="listorders[{$vo.id}]" class="input input-order"  type='text' size='3' value='{$vo.listorder}'></td>
		            <td><a>{$vo.id}</a></td>
		            <td><span>{$vo.cs_name}</span></td>
                    <td>
    	               {$vo.coursetype_name}
    	            </td>
    	            <td>
    	               {$vo.labelid|getlablename}
    	            </td>
    	            <td>
    	               {$vo.num}
    	            </td>
		            <td>{$vo.cs_teacher|getusername}</td>
		            <td>{$vo.cs_addtime}</td>
		            <td>{$status[$vo['cs_state']]}<br>{$recommend_status[$vo['is_tuijian']]}</td>
		            <td>
		                <div class="btn-group">
		                   <a  class="btn btn-default btn-sm" href="{:u('course/AdminSection/add',array('cs_id'=>$vo['id']))}">添加</a>
                           <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
                             <span class="caret"></span>
                             <span class="sr-only"></span>                             
                           </button>                          
                           <ul class="dropdown-menu pull-right" role="menu" >
                             <li><a href="{:u('course/AdminSection/index_cs',array('cs_id'=>$vo['id']))}">课时列表</a></li>
                             <li><a href="{:u('course/AdminMaterial/index_cs',array('cs_id'=>$vo['id']))}">资料列表</a></li>
                             <li><a href="javascript:open_iframe_dialog('{:U('Course/AdminCourse/xueyuan',array('cs_id'=>$vo['id']))}','学员列表')">学员列表</a></li>
                             <li><a href="javascript:open_iframe_dialog('{:U('Course/AdminCourse/pinglun',array('cs_id'=>$vo['id']))}','评论列表')">评论列表</a></li>
                             <li><a href="{:u('card/AdminCard/index_cs',array('cs_id'=>$vo['id']))}">激活点卡</a></li>
                             <li class="divider"></li>
                             <li><a href="{:U('AdminCourse/edit',array('id' => $vo['id']))}">修改课程</a></li>
                             <li><a href="{:U('AdminCourse/delete',array('id' => $vo['id']))}" class="js-ajax-delete" data-subcheck="true" data-msg="你确定删除吗？">删除课程</a></li>
                           </ul>
                          </div>
					</td>
	          	</tr>
          </foreach>
          <thead>
	          <tr>
	            <th width="16"><label><input type="checkbox" class="js-check-all" data-direction="x" data-checklist="js-check-x"></label></th>
	            <th width="50">排序</th>
	            <th width="40">ID</th>
	            <th>课程名称</th>
	            <th>所属分类</th>
	            <th width="100">标签</th>
	            <th width="60">学员数</th>
	            <th width="60">发布人</th>
	            <th width="130"><span>发布时间</span></th>
	            <th width="60">状态</th>
	            <th width="100">操作</th>
	          </tr>
        </thead>
          </table>
          <div class="pagination">{$Page}</div>   
      <div class="form-actions">                       
        <button class="btn btn-primary js-ajax-submit" type="submit" data-action="{:u('AdminCourse/listorders')}">排序</button>
        <button class="btn btn-primary js-ajax-submit" type="submit" data-action="{:u('AdminCourse/check',array('check'=>1))}" data-subcheck="true" >审核</button>
        <button class="btn btn-primary js-ajax-submit" type="submit" data-action="{:u('AdminCourse/check',array('uncheck'=>1))}" data-subcheck="true" >取消审核</button>
        <button class="btn btn-primary js-ajax-submit" type="submit" data-action="{:u('AdminCourse/recommend',array('recommend'=>1))}" data-subcheck="true" >推荐</button>
        <button class="btn btn-primary js-ajax-submit" type="submit" data-action="{:U('AdminCourse/recommend',array('unrecommend'=>1))}" data-subcheck="true">取消推荐</button>
        <button class="btn btn-primary js-ajax-submit" type="submit" data-action="{:u('AdminCourse/delete')}">删除</button>
        <button class="btn btn-primary" type="button" id="J_Content_remove">批量移动</button>
      </div>
  </form>
</div>
<script src="__PUBLIC__/js/common.js"></script>
<script>
function refersh_window() {
    var refersh_time = getCookie('refersh_time');
    if (refersh_time == 1) {
        window.location="{:u('AdminCourse/index',$formget)}";
    }
}
setInterval(function(){
	refersh_window();
}, 2000);
$(function () {
	setCookie("refersh_time",0);
    Wind.use('ajaxForm','artDialog','iframeTools', function () {
        //批量移动
        $('#J_Content_remove').click(function (e) {
            var str = 0;
            var id = tag = '';
            $("input[name='ids[]']").each(function () {
                if ($(this).attr('checked')) {
                    str = 1;
                    id += tag + $(this).val();
                    tag = ',';
                }
            });
            if (str == 0) {
				art.dialog.through({
					id:'error',
					icon: 'error',
					content: '您没有勾选信息，无法进行操作！',
					cancelVal: '关闭',
					cancel: true
				});
                return false;
            }
            var $this = $(this);
            art.dialog.open("__ROOT__/index.php?g=course&m=AdminCourse&a=move&ids=" + id, {
                title: "批量移动",
                width:"80%"
            });
        });
    });
});


</script>
</body>
</html>